% comandos generales
\newcommand{\code}[1]{\texttt{#1}}
\newcommand\bin[1]{\ensuremath{{#1}_\textsf{\tiny bin}}}
\newcommand{\abs}[1]{\left| #1 \right|}

% comandos útiles para el TP 1
\newcommand{\gregory}{\frac{\pi}{4} = \sum_{n=0}^{\infty}\frac{(-1)^n}{2n+1}}
\newcommand{\ramanujan}{\frac{1}{\pi} = \frac{\sqrt{8}}{9801}\sum_{n=0}^{\infty}\dfrac{(4n)!(1103+26390n)}{n!^4 396^{4n}}}
\newcommand{\machin}{\frac{\pi}{4} = 4 \arctan\left(\frac{1}{5}\right) - \arctan\left(\frac{1}{239}\right)}
\newcommand{\machinarctg}{\displaystyle\sum_{n=0}^{\infty} \left(-1\right)^n \frac{x^{2n+1}}{2n+1}}

% errores
\newcommand{\err}[1]{\varepsilon_{#1}}
\newcommand{\errmult}{\err{\otimes}}
\newcommand{\errsuma}{\err{\oplus}}
\newcommand{\errresta}{\err{\ominus}}
\newcommand{\errdiv}{\err{\oslash}}
\newcommand{\errpot}{\err{\wedge}}
\newcommand{\errcast}{\err{cast}}
\newcommand{\erep}{2^{1-t}}

% fórmulas de errores
\newcommand{\ferrsuma}[2]{\frac{{#1}\err{#1}+{#2}\err{#2}}{#1+#2}+\errsuma}
\newcommand{\ferrresta}[2]{\frac{{#1}\err{#1}-{#2}\err{#2}}{#1-#2}+\errresta}
\newcommand{\ferrdiv}[3][]{\err{#2}^{#1}-\err{#3}^{#1}+\errdiv^{#1}}
\newcommand{\ferrmult}[3][]{\err{#2}^{#1}+\err{#3}^{#1}+\errmult^{#1}}
\newcommand{\ferrpot}[2]{#2\err{#1}+\ln(#1)#2\err{#2}+\errpot}
